<?php
error_reporting(0);
ini_set('memory_limit', '1000M');
set_time_limit(0);


/** 
 *  mapper_9.php
 *      input:格式：mapred9输出 (json1\tjson2\t...)尤其要注意其中的weight字段
 *      handle:生成sql
 *      output:sql语句--INSERT INTO `house_sell_gov` VALUES ('1', ...);
 * @created 2016-03-09
 * @by delia
 */
while (($line_json = fgets(STDIN)) !== false) {   //line_json=>source_url\tjson格式
    $line_json = trim($line_json);
    list($suffix, $line_json) = explode("\t", $line_json);
    if (empty($line_json))
        continue;
    $one_dejson=json_decode($line_json,true); 
    $one_dejson['house_desc']=str_replace("'","",str_replace("\\","",$one_dejson['house_desc']));
    $one_dejson['house_title']=str_replace("'","",str_replace("\\","",$one_dejson['house_title']));
    $one_dejson['owner_name']=str_replace("'","",$one_dejson['owner_name']);
    echo json_encode($one_dejson)."\n";
}
?>

